<template>
     <tr>
          <td>
            <input type="checkbox"  v-model='item.checked'/> 
          </td>
          <td>{{name}}</td>
          <td>{{price}}</td>
          <td><button @click="btn1(index)" :disabled="num === 1">-</button>{{num}}<button @click="btn2(index)">+</button></td>
          <td>{{price * num}}</td>
          <td><button @click="btn3(index)">删除</button></td>
    </tr> 
</template>

<script>

export default {
  props:['name', 'price', 'num','checked','index','item'],
  data(){
    return {
      
    }
  },
  methods:{
    btn1(index){
     console.log( this.item)
        this.$emit('getBtn1',index)
    },
    btn2(index){
      this.$emit('getBtn2',index)
    },
    btn3(index){
      this.$emit('getBtn3',index)
    },
  }
}
</script>

<style  scoped>
 
</style>